module.exports = function(path,data,method){
  return new Promise((resolve,reject) => {
    console.log("http://localhost:8081/api/" + path);
    wx.request({
      url: 'http://localhost:8081/api/' + path,
      method: method,
      data: data,
      header: {
        'Content-Type' : 'json'
      },
      success: resolve,
      fail: function(){
        reject()
        wx.showModal({
          showCancel: false,
          title: '失败'
        })
      }
    })
  })

}